<%= error_messages_for 'declaration' %>

<!--[form:declaration]-->
<p><label for="declaration_amount">Bedrag</label><br/>
<%= text_field 'declaration', 'round_amount', {:size => 5, :maxlength => 5}  %>, <%= text_field 'declaration', 'decimal_amount', {:size => 1, :maxlength => 2}  %> EUR</p>

<%=
observe_amount_fields
%>

<p><label for="declaration_description">Omschrijving</label><br/>
<%= text_field 'declaration', 'description'  %></p>

<h4>Wie heeft betaald?</h4>
<div class="payers">
  <%= render :partial => 'declaration_owner', :object => @declaration_owner %>
</div>

<h4>Wie betalen mee?</h4>
<div class="participants" id="participants">
  <%= render :partial => 'declaration_payers', :locals => {:declaration_payers => @declaration_payers.values } %>
  
</div>

  <div class="add">
    <h5>Voeg iemand toe</h5>
    
    <%= collection_select('new_declaration_payer', 'user_id', @users, 'id', 'fullname', {:prompt => '-- Selecteer een betaler --'},
        {:onChange => remote_function(
          :update => "participants", 
          :url => { :controller => 'ajax', 
          #:action => 'declaration_users' },
          :action => 'add_user_to_declaration' },
          :submit => 'declaration_form'
          )
        }
    ) %>
    
  </div>

<!--[eoform:declaration]-->
